<?php
class FormsModel extends MongoModel {
	var $table = 'forms';
    var $name = '表单';
	
	/**
	 * 表单所有者
	 */
	public static function get_form_owner(){
		return array(
			'system' => '系统',
			'user' => '用户' 
		);
	}
	
	public function get_site_forms_option($conditions, $columns=null){
		if($columns === null){
			$columns = 'name,title';
		}
		$forms = $this->find(array(),$columns);
		$options = array();
		foreach ($forms as $k=>$v){
			$name = $v['name'];
			$options[$name] = $v['title'];
		}
		return $options;
	}
}

?>